package com.fastloan.mgt.customer.enums;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.serializer.SerializerFeature;
import com.fastloan.utils.DateTimeUtil;
import org.joda.time.DateTime;

import java.util.Date;

/**
 * Created by gelon on 2017/11/7.
 */
public class CustomerEnums {


    public enum Gender implements EnumInterface {
        CHOOSE(-1,"请选择"),
        MALE(1,"男"),
        FEMALE(2,"女")
        ;
        Integer code;
        String name;

        public void setCode(Integer code){
            this.code = code ;
        }

        public Integer getCode(){
            return this.code ;
        }

        public void setName(){
            this.name = name ;
        }

        public String getName(){
            return this.name ;
        }

        Gender (Integer code , String name) {
            this.code = code ;
            this.name = name ;
        }

        public String toString(){
            return "{\"code\":" + jsonStr(code) + ",\"name\":" + jsonStr(name) + "}";
        }

        public String jsonStr(Object param){
            if(param instanceof String){
                return "\"" + param + "\"";
            }else{
                return param.toString();
            }
        }
    }


    public enum Education implements EnumInterface {
        CHOOSE(-1,"请选择"),
        NONE_EDU(0,"无学历"),
        PRIMARY_SCHOOL(1,"小学"),
        JUNIOR_MIDDLE_SCHOOL(2,"初中"),
        TECHNICAL_SCHOOL(3,"中专"),
        JUNIOR_HIGH_SCHOOL(4,"高中"),
        COLLEGE(5,"大专"),
        UNDERGRADUATE(6,"本科"),
        MASTER(6,"硕士"),
        DOCTOR(7,"博士"),
        POST_DOCTORED(8,"博士后")
        ;
        Integer code;
        String name;

        public void setCode(Integer code){
            this.code = code ;
        }

        public Integer getCode(){
            return this.code ;
        }

        public void setName(){
            this.name = name ;
        }

        public String getName(){
            return this.name ;
        }

        Education (Integer code , String name) {
            this.code = code ;
            this.name = name ;
        }

        public String toString(){
            return "{\"code\":" + jsonStr(code) + ",\"name\":" + jsonStr(name) + "}";
        }

        public String jsonStr(Object param){
            if(param instanceof String){
                return "\"" + param + "\"";
            }else{
                return param.toString();
            }
        }

    }



    public enum Marrital implements EnumInterface {
        CHOOSE(-1,"请选择"),
        SINGLE(0,"未婚"),
        MARRIED(1,"已婚"),
        DIVORCED(2,"离异"),
        WIDOWED(3,"丧偶")
        ;
        Integer code;
        String name;

        public void setCode(Integer code){
            this.code = code ;
        }

        public Integer getCode(){
            return this.code ;
        }

        public void setName(){
            this.name = name ;
        }

        public String getName(){
            return this.name ;
        }

        Marrital (Integer code , String name) {
            this.code = code ;
            this.name = name ;
        }

        public String toString(){
            return "{\"code\":" + jsonStr(code) + ",\"name\":" + jsonStr(name) + "}";
        }

        public String jsonStr(Object param){
            if(param instanceof String){
                return "\"" + param + "\"";
            }else{
                return param.toString();
            }
        }

    }


    public enum Health implements EnumInterface {
        CHOOSE(-1,"请选择"),
        GOOD_HEALTH(0,"健康"),
        GENERATAL_HEALTH(1,"一般"),
        UNHEALTH(2,"不健康")
        ;
        Integer code;
        String name;

        public void setCode(Integer code){
            this.code = code ;
        }

        public Integer getCode(){
            return this.code ;
        }

        public void setName(){
            this.name = name ;
        }

        public String getName(){
            return this.name ;
        }

        Health (Integer code , String name) {
            this.code = code ;
            this.name = name ;
        }

        public String toString(){
            return "{\"code\":" + jsonStr(code) + ",\"name\":" + jsonStr(name) + "}";
        }

        public String jsonStr(Object param){
            if(param instanceof String){
                return "\"" + param + "\"";
            }else{
                return param.toString();
            }
        }
    }

    public enum Housing implements EnumInterface {
        CHOOSE(-1,"请选择"),
        OWNER(0,"自有"),
        MORTGAGE(1,"按揭"),
        FAMILY_OWNER(2,"家人拥有"),
        IN_BUSINESS_SPACE(3,"主经营场所"),
        RENTEL(4,"租住"),
        OTHER(5,"其他")
        ;
        Integer code;
        String name;

        public void setCode(Integer code){
            this.code = code ;
        }

        public Integer getCode(){
            return this.code ;
        }

        public void setName(){
            this.name = name ;
        }

        public String getName(){
            return this.name ;
        }

        Housing (Integer code , String name) {
            this.code = code ;
            this.name = name ;
        }


        public String toString(){
            return "{\"code\":" + jsonStr(code) + ",\"name\":" + jsonStr(name) + "}";
        }

        public String jsonStr(Object param){
            if(param instanceof String){
                return "\"" + param + "\"";
            }else{
                return param.toString();
            }
        }
    }






    public enum CustomerStatus implements EnumInterface {
        NOT_STOCK(0,"潜在"),
        STOCK(1,"存量");

        Integer code;
        String name ;

        CustomerStatus(Integer code, String name) {
            this.code = code;
            this.name = name;
        }


        public Integer getCode() {
            return code;
        }

        public String getName() {
            return name;
        }


        public CustomerStatus setCode(int code) {
            this.code = code;
            return this;
        }

        public CustomerStatus setName(String name) {
            this.name = name;
            return this;
        }

        public String toString(){
            return "{\"code\":" + jsonStr(code) + ",\"name\":" + jsonStr(name) + "}";
        }

        public String jsonStr(Object param){
            if(param instanceof String){
                return "\"" + param + "\"";
            }else{
                return param.toString();
            }
        }
    }




    public enum Industry implements EnumInterface {
        CHOOSE(-1,"请选择"),
        T0(0,"农林、牧、渔业"),
        T1(1,"采矿业"),
        T2(2,"制造业"),
        T3(3,"电力，热力，燃气以及水电生成和供应业"),
        T4(4,"建筑业"),
        T5(5,"批发和零售业"),
        T6(6,"交通运输、仓储和邮政业"),
        T7(7,"住宿和餐饮业"),
        T8(8,"信息传输、软件和信息技术服务业"),
        T9(9,"金融业"),
        T10(10,"房地产业"),
        T11(11,"租赁和商务服务业"),
        T12(12,"科学研究和技术服务业"),
        T13(13,"水利、环境和公共设施管理业"),
        T14(14,"居民服务、修理和其他服务业"),
        T15(15,"卫生和社会工作"),
        T16(16,"文化、体育和娱乐业"),
        T17(17,"公共管理、社会保障和社会组织"),
        T18(18,"国际组织"),
        T19(19,"金融业")
        ;
        Integer code;
        String name;

        public void setCode(Integer code){
            this.code = code ;
        }

        public Integer getCode(){
            return this.code ;
        }

        public void setName(){
            this.name = name ;
        }

        public String getName(){
            return this.name ;
        }

        Industry (Integer code , String name) {
            this.code = code ;
            this.name = name ;
        }


        public String toString(){
            return "{\"code\":" + jsonStr(code) + ",\"name\":" + jsonStr(name) + "}";
        }

        public String jsonStr(Object param){
            if(param instanceof String){
                return "\"" + param + "\"";
            }else{
                return param.toString();
            }
        }
    }


    public enum WeatherAdmittance implements EnumInterface {

        ENTER(1,"符合"),
        REFUSE(2,"拒绝")
        ;
        Integer code;
        String name;

        public void setCode(Integer code){
            this.code = code ;
        }

        public Integer getCode(){
            return this.code ;
        }

        public void setName(){
            this.name = name ;
        }

        public String getName(){
            return this.name ;
        }

        WeatherAdmittance (Integer code , String name) {
            this.code = code ;
            this.name = name ;
        }


        public String toString(){
            return "{\"code\":" + jsonStr(code) + ",\"name\":" + jsonStr(name) + "}";
        }

        public String jsonStr(Object param){
            if(param instanceof String){
                return "\"" + param + "\"";
            }else{
                return param.toString();
            }
        }

    }


    public enum ApplyStatus implements EnumInterface {

        WRITED(1,"已填写申请表"),
        DEMAND_ONE_MONTH(2,"一个月有需求"),
        TEMP_NONE_DEMAND(3,"暂时无需求"),
        NONE_DEMAND(4,"完全无需求")
        ;
        Integer code;
        String name;

        public void setCode(Integer code){
            this.code = code ;
        }

        public Integer getCode(){
            return this.code ;
        }

        public void setName(){
            this.name = name ;
        }

        public String getName(){
            return this.name ;
        }

        ApplyStatus (Integer code , String name) {
            this.code = code ;
            this.name = name ;
        }


        public String toString(){
            return "{\"code\":" + jsonStr(code) + ",\"name\":" + jsonStr(name) + "}";
        }

        public String jsonStr(Object param){
            if(param instanceof String){
                return "\"" + param + "\"";
            }else{
                return param.toString();
            }
        }
    }


    public enum CustomerManner implements EnumInterface {

        VERY_FIT(1,"非常配合"),
        FIT(2,"配合"),
        REFUSE(3,"拒绝"),
        BAD_ATTITUDE(4,"态度恶劣")
        ;
        Integer code;
        String name;

        public void setCode(Integer code){
            this.code = code ;
        }

        public Integer getCode(){
            return this.code ;
        }

        public void setName(){
            this.name = name ;
        }

        public String getName(){
            return this.name ;
        }

        CustomerManner (Integer code , String name) {
            this.code = code ;
            this.name = name ;
        }

        public String toString(){
            return "{\"code\":" + jsonStr(code) + ",\"name\":" + jsonStr(name) + "}";
        }

        public String jsonStr(Object param){
            if(param instanceof String){
                return "\"" + param + "\"";
            }else{
                return param.toString();
            }
        }

    }


    public enum MarketionStatus implements EnumInterface {

        CLOSE(0,"关闭"),
        OPEN(1,"打开")
        ;
        Integer code;
        String name;

        public void setCode(Integer code){
            this.code = code ;
        }

        public Integer getCode(){
            return this.code ;
        }

        public void setName(){
            this.name = name ;
        }

        public String getName(){
            return this.name ;
        }

        MarketionStatus (Integer code , String name) {
            this.code = code ;
            this.name = name ;
        }

        public String toString(){
            return "{\"code\":" + jsonStr(code) + ",\"name\":" + jsonStr(name) + "}";
        }

        public String jsonStr(Object param){
            if(param instanceof String){
                return "\"" + param + "\"";
            }else{
                return param.toString();
            }
        }

    }


    public enum CommonYN implements EnumInterface {
        CHOOSE(-1,"请选择"),
        Y(1,"是"),
        N(0,"否")
        ;
        Integer code;
        String name;

        public void setCode(Integer code){
            this.code = code ;
        }

        public Integer getCode(){
            return this.code ;
        }

        public void setName(){
            this.name = name ;
        }

        public String getName(){
            return this.name ;
        }

        CommonYN(Integer code , String name) {
            this.code = code ;
            this.name = name ;
        }


        public String jsonStr(Object param){
            if(param instanceof String){
                return "\"" + param + "\"";
            }else{
                return param.toString();
            }
        }


        public String toString(){
            return "{\"code\":" + jsonStr(code) + ",\"name\":" + jsonStr(name) + "}";
        }
    }




    public enum RiskEnum{

        RISK(0,"风险"),
        BLACK(1,"黑名单")
        ;
        Integer code;
        String name;

        public void setCode(Integer code){
            this.code = code ;
        }

        public Integer getCode(){
            return this.code ;
        }

        public void setName(){
            this.name = name ;
        }

        public String getName(){
            return this.name ;
        }

        RiskEnum (Integer code , String name) {
            this.code = code ;
            this.name = name ;
        }

        public String jsonStr(Object param){
            if(param instanceof String){
                return "\"" + param + "\"";
            }else{
                return param.toString();
            }
        }


        public String toString(){
            return "{\"code\":" + jsonStr(code) + ",\"name\":" + jsonStr(name) + "}";
        }

    }

    public enum VerifyEnum{

        IS_VERIFY(0,"通过验证"),
        NO_VERIFY(1,"未通过验证");

        Integer code;
        String name;

        public void setCode(Integer code){
            this.code = code ;
        }

        public Integer getCode(){
            return this.code ;
        }

        public void setName(){
            this.name = name ;
        }

        public String getName(){
            return this.name ;
        }

        VerifyEnum (Integer code , String name) {
            this.code = code ;
            this.name = name ;
        }

        public String jsonStr(Object param){
            if(param instanceof String){
                return "\"" + param + "\"";
            }else{
                return param.toString();
            }
        }


        public String toString(){
            return "{\"code\":" + jsonStr(code) + ",\"name\":" + jsonStr(name) + "}";
        }

    }

//    public static void main(String... args){
//
//        System.out.println(DateTimeUtil.format(new Date(1513699200000L),DateTimeUtil.DIGIT_DATETIME_PATTERN));
//        System.out.println(JSON.toJSONString(CommonYN.values(), SerializerFeature.WriteEnumUsingToString));
//    }

}
